package com.study.ming.websocket;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author yh
 * @date 2022/10/18 11:28
 **/
@RestController
@RefreshScope
public class ConfigClientController {
    @Value("${config.info}")
    private String info;

    @GetMapping("/configInfo")
    public String getInfo(){
        return info;
    }

    public static void main(String[] args) {

        int [] arr = {2,3,1,5,4};
//        int x = arr[0];
//        arr[0] = 44;
//        System.out.println(x);
        for (int i = 0; i < arr.length; i++) {
            for (int j = 0; j < arr.length - i - 1; j++) {
                int a = arr[j];
                int b = arr[j+1];
                if(a>b){
                    arr[j] = b;
                    arr[j+1]= a;
                }
            }
        }
        for (int i = 0; i < arr.length; i++) {
            System.out.println(arr[i]);
        }
    }
}
